﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MoviesWebsite.Models
{
    public class UserRating
    {
        int _rating;

        public int ID { get; set; }
        public Movie Movie { get; set; }
        public int MovieID { get; set; }
        public User User { get; set; }
        public string UserUsername { get; set; }
        public int Rating {
            get {
                return _rating;
            }
            set {
                if (value < 0 || value > 5) throw new ArgumentOutOfRangeException("Ratings must in the range 0 to 5");
                _rating = value;
            }
        }
    }
}